package com.company;

import com.company.service.JsonString;
import com.company.service.Test;

import java.util.ArrayList;

public class Task3 {
    public static void main(String[] args) {
        //todo 3.创建一个带id属性的实体类，覆写hashCode和equals方法；将实体类放入集合中，使相同id值得对象不重复；
        Test test1 = new Test(1,18,"张三");
        Test test2 = new Test(1,18,"李四");

        System.out.println(test1.equals(test2));
        ArrayList list =new ArrayList();
        list.add(test1.hashCode());
        list.add(test2.hashCode());

        System.out.println(list);

    }
}
